#pragma once
#include "Character.h"
//#include "Item.h"

class Luigi : public Character
{
protected:
	//Item items[10];
	short maxFP;
	int fP; // Flower points
	bool isJumping;
	int resistance;
	struct hammer
	{
		string names;
		short damage;
	};
	struct boots
	{
		string name;
		short damage;
	};

public:
	Luigi()
	{
		name = "Luigi";
		maxHP = 10;
		hP = maxHP;
		maxFP = 10;
		fP = maxFP;
		attack = 1;
		defense = 0;
		//ZeroMemory(items);
		position.x = 300;
		position.y = 300;
		position.z = 0;
		isJumping = false;
		resistance = 1;
	}

	void setPosition(float bottom)
	{
		position.y += bottom;
	}

	string getName()
	{
		return name;
	}

	int getHP()
	{
		return hP;
	}

	short getMaxHP()
	{
		return maxHP;
	}

	int getFP()
	{
		return fP;
	}

	short getMaxFP()
	{
		return maxFP;
	}

	short getAttack()
	{
		return attack;
	}

	D3DXVECTOR3 getPosition()
	{
		return position;
	}

	void setHammer(string name, short damage)
	{
		//hammer.name = name;
	}

	void damageTaken(int damage)
	{
		hP -= (damage - defense);
	}

	void MovementX(int distance, float dt)
	{
		position.x += distance*dt;
	}

	void MovementZ(int distance, float dt)
	{
		//position.z += distance*dt;
	}

	/*void addItem(Item newItem)
	{
		for(int n = 0; n < 10; ++n)
		{
			if(item[n] == NULL)
			{
				item[n] = newItem;
				return;
			}
		}
	}

	void removeItem(int selection)
	{
		if(item[0] = NULL)
		{
			return;
		}
		else
		{
			item[selection] = NULL;
			while(item[selection + 1] != NULL)
			{
				item[selection] = item[selection + 1];
				selection++;
			}
		}
	}*/

	void jump()
	{
		// add to the y vector until a certain height it met then subtract until bottom collision
		if(!isJumping)
			isJumping = true;
		else
			isJumping = false;
	}

	void hammer()
	{
		// hammer action
	}

	// individual testing for if Luigi comes into contact with an enemy
	bool isEnemyCollision(D3DXVECTOR3 enemyLoc)
	{
		if((position.x < enemyLoc.x + 3) && (position.y < enemyLoc.y + 3) && (position.z < enemyLoc.z + 3))
		{
			return true;
		}
		else
			return false;
	}

	bool isBottomCollision()
	{
		if(position.y + m_IIChar.Height*.25 >= 600)
		{
			return true;
		}
		else
			return false;
	}

	void gravityEffect(float dt)
	{
		if(isJumping)
		{
			position.y += -1000 * dt;
			++resistance;
			if(position.y + m_IIChar.Height*.25 <= 350)
			{
				isJumping = false;
				resistance = 1;
			}
		}
		else if((position.y + m_IIChar.Height*.25) >= 600)
		{
			return;
		}
		
		else
		{
			position.y += 100 * dt;
		}
	}

	~Luigi()
	{
	}
};